/*Author : Rozi Kapara Dista*/

package jtk.project4.fleet.field;

import java.awt.Dimension;

import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.CalendarControl;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.button.CheckButton;
import nl.coderight.jazz.form.field.ComboField;
import nl.coderight.jazz.form.field.SelectField;
import nl.coderight.jazz.form.field.TextField;

public class EditScheduleRepairField extends GroupControl{
	private SelectField equipmentField;
	private CalendarControl repairDateField;
	private TextField repairUnitsField;
	private ComboField reqByField;
	private CheckButton delayNotifField;
	
	public EditScheduleRepairField(String bindID){
		setTitle("header.EditScheduleRepair");
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	private void createFields(){
		equipmentField = new SelectField<String>("domains","domain");
		equipmentField.setPreferredSize(new Dimension(166, 20));
		repairDateField = new CalendarControl("tgl",20);
		repairDateField.showYearSpinner(true);
		repairDateField.setPreferredSize(new Dimension(166, 20));
		repairUnitsField = new TextField("repairunits", 12);
		reqByField = new ComboField<String>("employees","status");
		reqByField.setPreferredSize(new Dimension(166, 20));
		delayNotifField = new CheckButton("Delay notification until next PM");
	}
	
	private void createLayout() {
		setLayout(new FormLayout())
		.addLabel("Equipment:")
		.addField(equipmentField)
		.addLabel("Repair By/On (Date):")
		.addField(repairDateField)
		.addLabel("Repair By/On (Units):")
		.addField(repairUnitsField)
		.addLabel("Requested By:")
		.addField(reqByField)
		.addRow()
		.addLabel("Enter Repairs Needed:")		
		.addField(delayNotifField);
	}
	
}
